package com.atguigu.gmall.cart.client;

import com.atguigu.gmall.cart.client.impl.CartFeignClientImpl;
import com.atguigu.gmall.model.cart.CartInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@FeignClient(value = "service-cart",fallback = CartFeignClientImpl.class)
public interface CartFeignClient {

    @ApiOperation("添加购物车")
    @PostMapping("/api/cart/addCart/{skuId}/{skuNum}")
    public void addCart(@PathVariable Long skuId, @PathVariable Integer skuNum);

    @ApiOperation("获取购物车中间信息")
    @PostMapping("/api/cart/toCart/{skuId}")
    public CartInfo toCart(@PathVariable Long skuId);

    @ApiOperation("远程调用商品清单")
    @GetMapping("/api/cart/getCartListChecked")
    public List<CartInfo> getCartListChecked();
}
